package com.settlement.system.controller;

import com.settlement.system.service.IBaseService;
import com.settlement.system.common.util.common.FasUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.settlement.system.model.entity.common.TblNcVurcherNoRecord;
import jakarta.annotation.Resource;
import com.settlement.system.service.ITblNcVurcherNoRecordService;

import java.util.Arrays;
import java.util.List;
import java.util.Map;

/**
 * NC凭证明细-【操作记录】页签表 前端控制器
 * @author hc
 * @since 2023-03-09
 */

@Api(tags = "NC凭证明细-【操作记录】页签表",description = "NC凭证明细-【操作记录】页签表")
@RestController
@RequestMapping("/nc/nc-vurcher-no-record")
public class TblNcVurcherNoRecordController extends BaseController<TblNcVurcherNoRecord> {

    @Resource
    private ITblNcVurcherNoRecordService tblNcVurcherNoRecordService;

    @Override
    public IBaseService init() {
        return tblNcVurcherNoRecordService;
    }

    @Override
    protected void setParamsModel(Map<String, Object> model) {
        String companyNo = (String) model.get("companyNo");
        if(StringUtils.isNotEmpty(companyNo)){
            List<String> companyNoList = Arrays.asList(companyNo.split(","));
            model.put("companyNoList",companyNoList);
        }
        FasUtil.formatInQueryCondition(model, "editorName", "companyNo", "summaryId");
    }
}

